﻿#include "DecoObject.h"
#include "../MirScenes/GameScene.h"
#include "../MirGraphics/MLibrary.h"

using namespace Client::MirGraphics;
using namespace Client::MirScenes;
namespace S = ServerPackets;

namespace Client::MirObjects
{

    ObjectType DecoObject::getRace() const
    {
        return ObjectType::Deco;
    }

    bool DecoObject::getBlocking() const
    {
        return false;
    }

    DecoObject::DecoObject(unsigned int objectID) : MapObject(objectID)
    {
    }

    void DecoObject::Load(S::ObjectDeco *info)
    {
        CurrentLocation = info->Location;
        MapLocation = info->Location;
        GameScene::Scene->MapControl->AddObject(this);
        Image = info->Image;

        BodyLibrary = Libraries::Deco;
    }

    void DecoObject::Process()
    {
        DrawLocation = new Point((CurrentLocation->X - User->Movement->X + MapControl::OffSetX) * MapControl::CellWidth, (CurrentLocation->Y - User->Movement->Y + MapControl::OffSetY) * MapControl::CellHeight);
        DrawLocation->Offset(getGlobalDisplayLocationOffset());
        DrawLocation->Offset(User->OffSetMove);
    }

    void DecoObject::Draw()
    {
        BodyLibrary->Draw(Image, DrawLocation, DrawColour, true);
    }

    bool DecoObject::MouseOver(Point *p)
    {
        return false;
    }

    void DecoObject::DrawBehindEffects(bool effectsEnabled)
    {
    }

    void DecoObject::DrawEffects(bool effectsEnabled)
    {
    }
}
